<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>Palworld Game Settings</title>
	<link rel="stylesheet" href="/web/css/style.css">
	<link rel="shortcut icon" href="https://tech.palworldgame.com/favicon.ico">
	<script>
		var _hmt = _hmt || [];
		(function() {
			var hm = document.createElement("script");
			hm.src = "https://hm.baidu.com/hm.js?30262754a1bc9d066c52280df5faadfa";
			var s = document.getElementsByTagName("script")[0];
			s.parentNode.insertBefore(hm, s);
		})();
	</script>
	<script>
		function fetchConfigData() {
			const apiUrl = 'http://127.0.0.1:8080/config';
			fetch(apiUrl)
					.then(response => response.json())  // Parse the JSON response
					.then(data => {
						const configTextArea = document.getElementById('configText');
						configTextArea.value = data.data;
						parseConfig();
					})
					.catch(error => {
						console.error('Error fetching data:', error);
					});

		}
		window.onload = fetchConfigData;
	</script>
</head>
<body>
	<h1><font color=white>PalWorldSettings.ini</font></h1>
<!--	<div>-->
<!--		<textarea rows="10" cols="95" id="configText" placeholder="请输入游戏配置内容" oninput="parseConfig()">[/Script/Pal.PalGameWorldSettings]-->
<!--OptionSettings=(Difficulty=None,DayTimeSpeedRate=1.000000,NightTimeSpeedRate=1.000000,ExpRate=1.000000,PalCaptureRate=1.000000,PalSpawnNumRate=1.000000,PalDamageRateAttack=1.000000,PalDamageRateDefense=1.000000,PlayerDamageRateAttack=1.000000,PlayerDamageRateDefense=1.000000,PlayerStomachDecreaceRate=1.000000,PlayerStaminaDecreaceRate=1.000000,PlayerAutoHPRegeneRate=1.000000,PlayerAutoHpRegeneRateInSleep=1.000000,PalStomachDecreaceRate=1.000000,PalStaminaDecreaceRate=1.000000,PalAutoHPRegeneRate=1.000000,PalAutoHpRegeneRateInSleep=1.000000,BuildObjectDamageRate=1.000000,BuildObjectDeteriorationDamageRate=1.000000,CollectionDropRate=1.000000,CollectionObjectHpRate=1.000000,CollectionObjectRespawnSpeedRate=1.000000,EnemyDropItemRate=1.000000,DeathPenalty=All,bEnablePlayerToPlayerDamage=False,bEnableFriendlyFire=False,bEnableInvaderEnemy=True,bActiveUNKO=False,bEnableAimAssistPad=True,bEnableAimAssistKeyboard=False,DropItemMaxNum=3000,DropItemMaxNum_UNKO=100,BaseCampMaxNum=128,BaseCampWorkerMaxNum=15,DropItemAliveMaxHours=1.000000,bAutoResetGuildNoOnlinePlayers=False,AutoResetGuildTimeNoOnlinePlayers=72.000000,GuildPlayerMaxNum=20,BaseCampMaxNumInGuild=4,PalEggDefaultHatchingTime=72.000000,WorkSpeedRate=1.000000,AutoSaveSpan=30.000000,bIsMultiplay=False,bIsPvP=False,bCanPickupOtherGuildDeathPenaltyDrop=False,bEnableNonLoginPenalty=True,bEnableFastTravel=True,bIsStartLocationSelectByMap=True,bExistPlayerAfterLogout=False,bEnableDefenseOtherGuildPlayer=False,bInvisibleOtherGuildBaseCampAreaFX=False,CoopPlayerMaxNum=4,ServerPlayerMaxNum=32,ServerName="Default Palworld Server",ServerDescription="",AdminPassword="",ServerPassword="",PublicPort=8211,PublicIP="",RCONEnabled=False,RCONPort=25575,Region="",bUseAuth=True,BanListURL="https://api.palworldgame.com/api/banlist.txt",RESTAPIEnabled=False,RESTAPIPort=8212,bShowPlayerList=False,AllowConnectPlatform=Steam,bIsUseBackupSaveData=True,LogFormatType=Text,SupplyDropSpan=180)-->
<!--</textarea><br><br>-->
<!--	</div>-->
	<div>
		<textarea rows="10" cols="95" id="configText" placeholder="请输入游戏配置内容" oninput="parseConfig()"></textarea><br><br>
	</div>

	<div id="configItems"></div>
	<br><br>

	<div class="container">
		<input id="copyResult" type="button" class="float-button" value="修改配置" onclick="sendConfigData()">
	</div>

	<script src="/web/js/util.js"></script>
	<script src="/web/js/meta.js"></script>
	<script src="/web/js/preset.js"></script>
	<script src="/web/js/main.js"></script>
	<script>
		document.addEventListener('DOMContentLoaded', (event) => { parseConfig(); });
	</script>
</body>
</html>
